package com.uncp.comisiondeadmision.carnet.service;


import java.util.ArrayList;

import com.uncp.comisiondeadmision.carnet.beans.CarnetBean;
import com.uncp.comisiondeadmision.carnet.beans.CarnetPostuMixBean;
import com.uncp.comisiondeadmision.carnet.dao.CarnetDAO;
import com.uncp.comisiondeadmision.carnet.dao.PostulanteCarnetDAO;
import com.uncp.comisiondeadmision.comprobantedepago.beans.PostulanteBean;
import com.uncp.comisiondeadmision.fabricas.DAOFactory;



public class CarnetService {

	DAOFactory subFabrica = DAOFactory.getSubFabrica(DAOFactory.MYSQL);
	CarnetDAO carnet = subFabrica.getCarnet();
	PostulanteCarnetDAO postulante = subFabrica.getPostulanteCarnet();
	
	public ArrayList<PostulanteBean> getConsulPostu() throws Exception{
		return carnet.consultaActivos();
	}
	public PostulanteBean getConBusPos(Integer codigo,String estado) throws Exception{		
		return carnet.consultaXCodigo(codigo,estado);
	}
	public boolean getActuCarnet(Integer cod) throws Exception{
		return carnet.actualizaEstado(cod);
	}
	public int getRegistrarCarnet(CarnetBean bean) throws Exception{
			return carnet.insertarCarnet(bean);	
	}
	public int getCodigoGenerado()throws Exception{
		return carnet.codigoGenerado();
	}
	public ArrayList<CarnetPostuMixBean> getlistaPostuConCarnet() throws Exception {
	        return carnet.listaPostuConCarnet();
	   }
	public ArrayList<PostulanteBean> getConsultaPendientes() throws Exception{
		return postulante.consultaPendiente();
	}

	
	
	
}
